//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.come.Frame;

import com.tool.tcpimg.UIUtils;
import org.come.Jpanel.ShaoXiangJpanel;
import org.come.socket.Agreement;
import org.come.socket.SendMessageUntil;
import org.come.until.FormsManagement;

import javax.swing.*;
import javax.swing.plaf.basic.BasicInternalFrameUI;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

public class ShaoXiangJframe extends JInternalFrame implements MouseListener {
	private ShaoXiangJpanel shaoXiangJpanel;

	private int first_x;
	private int first_y;

	public static ShaoXiangJframe getShaoXiangJframe() {
		return (ShaoXiangJframe)FormsManagement.getInternalForm(636).getFrame();
	}

	public ShaoXiangJframe(int gheight) {
		//读取
		String sendmes = Agreement.getAgreement().shaoxiangAgreement("GETLIMIT");
		SendMessageUntil.toServer(sendmes);

		this.shaoXiangJpanel = new ShaoXiangJpanel();
		this.add(this.shaoXiangJpanel);
		this.setBackground(UIUtils.Color_BACK);
		this.setBorder(BorderFactory.createEmptyBorder());
		((BasicInternalFrameUI)this.getUI()).setNorthPane((JComponent)null);
		this.setBounds(300, 200, 400, gheight);
		this.pack();
		this.setVisible(false);
		this.setDefaultCloseOperation(3);
		this.addMouseListener(this);
		this.addMouseMotionListener(new MouseMotionListener() {
			public void mouseMoved(MouseEvent e) {
			}

			public void mouseDragged(MouseEvent e) {
				if (ShaoXiangJframe.this.isVisible()) {
					int x = e.getX() - ShaoXiangJframe.this.first_x;
					int y = e.getY() - ShaoXiangJframe.this.first_y;
					ShaoXiangJframe.this.setBounds(x + ShaoXiangJframe.this.getX(), y + ShaoXiangJframe.this.getY(), ShaoXiangJframe.this.getWidth(), ShaoXiangJframe.this.getHeight());
				}

			}
		});
	}

	public void mouseClicked(MouseEvent e) {

	}

	public void mousePressed(MouseEvent e) {
		if (e.isMetaDown()) {
			FormsManagement.HideForm(636);
		} else {
			FormsManagement.Switchinglevel(636);
		}
		this.first_x = e.getX();
		this.first_y = e.getY();

	}

	public void mouseReleased(MouseEvent e) {
	}

	public void mouseEntered(MouseEvent e) {
	}

	public void mouseExited(MouseEvent e) {
	}

	public int getFirst_x() {
		return this.first_x;
	}

	public void setFirst_x(int first_x) {
		this.first_x = first_x;
	}

	public int getFirst_y() {
		return this.first_y;
	}

	public void setFirst_y(int first_y) {
		this.first_y = first_y;
	}
}
